package org.jupiter.blog.api.convertor;

import org.jupiter.blog.api.domain.JupiterRolePermission;
import org.jupiter.blog.api.dto.JupiterRolePermissionDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface JupiterRolePermissionStructConvertor {

	@Mapping(target = "createTime", ignore = true)
	@Mapping(target = "updateTime", ignore = true)
	@Mapping(target = "permissionUuid", ignore = true)
		// 因为 permissionUuids 是 List，单个映射忽略
	JupiterRolePermission toEntity(JupiterRolePermissionDTO dto);

	// 通常 DTO 和 Entity 结构不完全一一对应，这里只做简单映射
	JupiterRolePermissionDTO toDto(JupiterRolePermission entity);
}
